package com.itheima.mapper;

import com.itheima.entity.Dept;
import com.itheima.entity.Dish;
import com.itheima.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface DeptMapper {
    //查询所有部门列表
    @Select("select *from emp.dept dept")
    List<Dept> selectAll();

    // 根据id删除部门信息
    @Delete("delete from emp.dept dept where id = #{id}")
    void deleteBuId(Integer id);

    //添加部门信息
    @Insert("insert into emp.dept(id, name, create_time, update_time) values (null,#{name},#{createTime},#{updateTime});")
    void insert(Dept dept);
    // 根据id查询部门信息
   /* @Select("select *from emp.dept dept where id = #{id}")
    void listDept(Integer id);*/
    @Select("select * from emp.dept dept where id = #{id}")
    Dept selectb(Integer id);
    // 修改
    @Update("update emp.dept dept set name=#{name} ,update_time=#{updateTime} where id=#{id}")
    void update(Dept dept);
}
